<!--
 * Description: RFQ solution页面
 * Company: 联宝（合肥）电子科技有限公司
 * Author: Chengming.Li
 * Date: 2020/11/24 11:26
-->

<template>
  <BaseWrap>
    <!-- 详情数据 -->
    <RfqTotalDetailView
      v-if="isDetailDataTotal"
      :rowData="currentRowData"
      @cancel="isDetailDataTotal = false"
    />
    <!-- 基础数据 -->
    <RfqTotalBaseData v-else ref="baseData" :rfqDataType="'1'" />
  </BaseWrap>
</template>

<script>
import RfqTotalBaseData from './components/RfqTotalBaseData'
import RfqTotalDetailView from './components/RfqTotalDetailView'

export default {
  name: 'RfqTotal',
  components: { RfqTotalBaseData, RfqTotalDetailView },
  props: {},
  data() {
    return {
      // 是否显示详情数据
      isDetailDataTotal: false,
      // 当前行的数据
      currentRowData: {}
    }
  },
  computed: {},
  watch: {},
  created() {
    /** 详情数据查看 */
    this.$bus.$on('RfqTotal-detail-view', (index, rowData) => {
      this.currentRowData = rowData
      this.isDetailDataTotal = true
    })
  },
  mounted() {},
  beforeDestroy() {
    /** 详情数据查看 */
    this.$bus.$off('RfqTotal-detail-view')
  },
  methods: {}
}
</script>
